<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui" >
<f:view locale="#{localeBean.currentLocale}" />
<h:head>
	<title>MOJ</title>
</h:head>
<h:body>
	<ui:composition>

			<p:panel >
			<h:form prependId="false" id="addForm" >
			<p:growl showDetail="true" id="messages"/>
				<h:panelGrid columns="4" >
					<p:outputLabel value="#{msgs['realtydocument.lable.realtyNo']}" />
					<p:inputText value="#{drawingDocumentBean.drawingDocument.realtyRegistrationNumber}" />
					<p:outputLabel value="#{msgs['realtydocument.lable.realtyYear']}" />
					<p:inputText value="#{drawingDocumentBean.drawingDocument.documentYear}"/>
					<p:commandButton value="#{msgs['btn.label.save']}" action="#{drawingDocumentBean.save}" rendered="#{drawingDocumentBean.editIndex == null}" update="addForm"/>
					<p:commandButton value="#{msgs['btn.label.save']}" action="#{drawingDocumentBean.save}"  rendered="#{drawingDocumentBean.editIndex != null}"  oncomplete="PF('addDoc').hide();" update=":searchForm"/>
					<p:commandButton value="#{msgs['btn.label.scan']}"/>				
					
				</h:panelGrid>
		</h:form>
		<h:form enctype="multipart/form-data">
			<p:fileUpload fileUploadListener="#{drawingDocumentBean.handleFileUpload}"  update=":addForm:messages"
           			sizeLimit="100000" allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
    	</h:form>
		</p:panel>
	</ui:composition>
</h:body>
</html>